#include "stdio.h"
#include "fcntl.h"  // open
#include "unistd.h" // read write
#include "errno.h"
#include "string.h"

int main(int argc, char const *argv[])
{
    close(STDIN_FILENO);
    close(STDOUT_FILENO);
    close(STDERR_FILENO);
    
    open("test/sys_call_test.c", O_RDONLY);
    open("test/sys_call_test.c.bak1", O_WRONLY | O_CREAT, 0777);

    char c;
    read(STDIN_FILENO, &c, 1);
    //printf("%c\n", c);
    write(STDOUT_FILENO, &c, 1);

    c = '\n';
    write(STDOUT_FILENO, &c, 1);
    return 0;
}
